package besta.moon.engine.store;

import java.sql.*;

import besta.moon.MoonConnection;
import besta.moon.engine.Table;


public class TableStorePageInsert extends TableStorePage {

    final private MoonPageLink link = new MoonPageLink();

    public TableStorePageInsert(MoonConnection con, Table table, int lockType) {
        super(con, table, lockType, -1);
        link.page = this;
        link.filePos = fileOffset;
    }

    @Override
    public final long commit() throws SQLException {
        long result = super.commit();
        link.filePos = fileOffset;
        link.page = null;
        return result;
    }

    public final MoonPageLink getLink() {
        return link;
    }
}
